package com.ricky.onlineShop.shop.trading.pojo;

import com.ricky.base.bean.BaseEntity;
import com.ricky.base.tool.target.comment.OComment;
import com.ricky.onlineShop.shop.trading.vo.TradingVo;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * @Author staticlan
 * @Date 2024/6/20 15:48
 * @Description: 交易网站信息
 */
@Entity
@Data
@Table(name = "TRADING_SHOP")
public class Trading extends BaseEntity {
    @OComment("网店编号")
    private String tradingNum;

    @OComment("网店分类")
    private String type;

    @OComment("网店旺旺")
    private String wangwangNum;

    @OComment("网店链接")
    private String link;

    @OComment("卖家到手价格")
    private BigDecimal handPrice;

    @OComment("网店出售价格")
    private BigDecimal sellingPrice;

    @OComment("历史假冒扣分-年")
    private String counterfeitYear;

    @OComment("历史假冒扣分-分")
    private String counterfeitScore;

    @OComment("网店信誉等级 见字典trading_reputation_level")
    private String reputationLevel;

    @OComment("主营类目 见字典trading_main_category")
    private String mainCategory;

    @OComment("创店时间")
    private String establishmentTime;

    @OComment("网店名称")
    private String shopName;

    @OComment("网店详情")
    private String shopDetails;

    @OComment("手机号")
    private String mobile;

    @OComment("QQ号")
    private String qqNum;

    @OComment("网店地址 s_province")
    private String shopAddress;

    @OComment("店铺标签")
    private String shopLabel;

    @OComment("请输入淘信誉")
    private String taobaoReputation;

    @OComment("出售人姓名")
    private String sellerName;

    @OComment("所在区域 s_province")
    private String localArea;

    @OComment("经营状态 trading_operating_state")
    private String operatingState;

    @OComment("店铺来源 trading_shop_source")
    private String shopSource;

    @OComment("好评率(%)")
    private String favorableRate;

//    @OComment("店铺类型")
//    private String shopType;

//    @OComment("是否过户 1:是，2:否")
//    private String transferOrNot;

//    @OComment("是否有差价 1:是，2:否")
//    private String priceDifference;

//    @OComment("优惠金额")
//    private BigDecimal discountAmount;

    @OComment("数据状态 0:已添加，1:已拍下，2:结束")
    private String dataStatus;

    @OComment("网店所属人")
    private String shopHolder;

    @OComment("网店所属人Id")
    private String shopHolderId;


    public static Trading toPojo(TradingVo tradingVo) {
        if ( tradingVo == null ) {
            return null;
        }

        Trading trading = new Trading();

        trading.setId( tradingVo.getId() );
        trading.setCreateTime( tradingVo.getCreateTime() );
        trading.setUpdateTime( tradingVo.getUpdateTime() );
        trading.setCreateUserId( tradingVo.getCreateUserId() );
        trading.setCreateUserName( tradingVo.getCreateUserName() );
        trading.setUpdateUserId( tradingVo.getUpdateUserId() );
        trading.setUpdateUserName( tradingVo.getUpdateUserName() );
        trading.setTradingNum( tradingVo.getTradingNum() );
        trading.setType( tradingVo.getType() );
        trading.setWangwangNum( tradingVo.getWangwangNum() );
        trading.setLink( tradingVo.getLink() );
        trading.setHandPrice( tradingVo.getHandPrice() );
        trading.setSellingPrice( tradingVo.getSellingPrice() );
        trading.setCounterfeitYear( tradingVo.getCounterfeitYear() );
        trading.setCounterfeitScore( tradingVo.getCounterfeitScore() );
        trading.setReputationLevel( tradingVo.getReputationLevel() );
        trading.setMainCategory( tradingVo.getMainCategory() );
        trading.setEstablishmentTime( tradingVo.getEstablishmentTime() );
        trading.setShopName( tradingVo.getShopName() );
        trading.setShopDetails( tradingVo.getShopDetails() );
        trading.setMobile( tradingVo.getMobile() );
        trading.setQqNum( tradingVo.getQqNum() );
        trading.setShopAddress( tradingVo.getShopAddress() );
        trading.setShopLabel( tradingVo.getShopLabel() );
        trading.setTaobaoReputation( tradingVo.getTaobaoReputation() );
        trading.setSellerName( tradingVo.getSellerName() );
        trading.setLocalArea( tradingVo.getLocalArea() );
        trading.setOperatingState( tradingVo.getOperatingState() );
        trading.setShopSource( tradingVo.getShopSource() );
        trading.setFavorableRate( tradingVo.getFavorableRate() );
        trading.setDataStatus( tradingVo.getDataStatus() );
        trading.setShopHolder( tradingVo.getShopHolder() );
        trading.setShopHolderId( tradingVo.getShopHolderId() );

        return trading;
    }

}
